<?php

if($_POST['title']){
	include_once('config.php');
	include_once(mnminclude.'KMessaging.php');

	$message =  new KMessaging();
	$message->tblName = table_messages;
	$sendmsg = $message->SendMessege($_POST['title'],$_POST['body'],$_POST['sender'],$_POST['receiver'],$_POST['senderlevel']);
	//echo $sendmsg . " end sql";
	//die();
	switch ($sendmsg) {
		case 0:
			echo "success";
			die();
			break;
		case 2:
			echo "nobody";
			die();
			break;
		case 6:
			echo "database_error";
			die();
			break;
		default:
			echo "fail";
			die();
			break;
	}
}
?>